package com.tywj.buscustomerapp.view.item;

import android.support.annotation.NonNull;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.tywj.buscustomerapp.R;
import com.tywj.buscustomerapp.model.bean.CityBean;
import com.tywj.buscustomerapp.utils.myadapter.item.AdapterItem;

public class CityItem implements AdapterItem<CityBean> {
    private LinearLayout top;
    private LinearLayout end;
    private ImageView localImg;
    private TextView cityName;
    @Override
    public int getLayoutResId() {
        return R.layout.item_city;
    }

    @Override
    public void bindViews(@NonNull View root) {
        top = root.findViewById(R.id.item_top);
        end = root.findViewById(R.id.item_bottom);
        localImg = root.findViewById(R.id.location_img);
        cityName = root.findViewById(R.id.city_name);
    }

    @Override
    public void setViews() {

    }

    @Override
    public void handleData(CityBean s, int position) {
//        if (position==0){
//            top.setVisibility(View.VISIBLE);
//            end.setVisibility(View.VISIBLE);
//            localImg.setVisibility(View.VISIBLE);
//        }else{
//            top.setVisibility(View.GONE);
//            end.setVisibility(View.GONE);
//            localImg.setVisibility(View.GONE);
//        }
        cityName.setText(s.getCityName());
    }
}
